﻿<%@ Page Language="C#" MasterPageFile="~/cms/cms.master" AutoEventWireup="true"
 CodeFile="roles.aspx.cs" Inherits="cms_roles" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="main-title">NHÓM NGƯỜI SỬ DỤNG:</div>
    <div class="main-content">
        <asp:GridView ID="gvRoles" runat="server" AutoGenerateColumns="False" 
            BorderStyle="None" ShowFooter="false"
            Width="100%" DataSourceID="odsRoles">
            <Columns>
                <asp:TemplateField HeaderText="Tên nhóm">
                    <ItemTemplate>
                        <a title="Click để xem và cập nhật danh sách người sử dụng trong nhóm"
                         href='<%# "users.aspx?role="+Container.DataItem.ToString() %>'>
                        <%# Container.DataItem.ToString() %></a>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox runat="server" ID="txtRoleName"></asp:TextBox>
                    </FooterTemplate>
                    <ItemStyle HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Xóa">
                    <ItemTemplate>
                        <asp:ImageButton ID="btnDelete" runat="server" 
                            OnClientClick="return confirm('Bạn có chắc chắn muốn xóa?');"
                            ImageUrl="~/images/delete_over.gif" onclick="btnDelete_Click" 
                            ToolTip="Xóa nhóm này" />
                    </ItemTemplate>
                    <FooterTemplate>
                        <div style="width:55px; text-align:center;">
                            <asp:LinkButton ID="lbtInsert" runat="server" CausesValidation="False" 
                                CommandName="Insert" ToolTip="Lưu" onclick="lbtInsert_Click">
                                <img alt="add" src="../images/save.gif" style="border:none;" />
                            </asp:LinkButton>
                            <asp:LinkButton ID="lbtCancel" runat="server" CausesValidation="False" 
                                CommandName="Cancel" ToolTip="Bỏ qua" onclick="lbtCancel_Click">
                                <img alt="cancel" src="../images/cancel.gif" style="border:none;" />
                            </asp:LinkButton>
                        </div>
                    </FooterTemplate>
                    <ItemStyle Width="60px" HorizontalAlign="Center" />
                </asp:TemplateField>
            </Columns>
            <HeaderStyle CssClass="gridHeader" />
            <RowStyle CssClass="gridRow" />
            <PagerStyle CssClass="gridPage" />
            <FooterStyle CssClass="gridFooter" />
            <EmptyDataTemplate>
                Chưa có dữ liệu trong hệ thống!
            </EmptyDataTemplate>
        </asp:GridView>
        <div class="gridviewAddNewButton">
            <asp:Button ID="btnNewRow" runat="server" Text="Thêm nhóm" 
                onclick="btnNewRow_Click" />
        </div>
        <asp:ObjectDataSource ID="odsRoles" TypeName="System.Web.Security.Roles" runat="server"
            SelectMethod="GetAllRoles" >
        </asp:ObjectDataSource>
    </div>
</asp:Content>

